{extend name="template/base" /}
{block name="nav"}{/block}
{block name="content"}
<div class="page-container">
    <form action="{:\\think\\Request::instance()->baseUrl()}" method="post" id="form" style="padding-top: 50px">
        <input type="hidden" name="id" VALUE="{$Request.param.id}" />
        <div class="cl pd-5 bg-1 bk-gray pos-f" style="left: 20px;right: 20px;top: 20px;">
            <span class="l">
                <button type="button" class="btn btn-primary radius" onclick="$('#checkAll').click()">&nbsp;&nbsp;全选&nbsp;&nbsp;</button>
            </span>
            <span class="r pt-5 pr-5">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;保存&nbsp;&nbsp;</button>
                <button type="button" class="ml-20 btn btn-default radius" onclick="layer_close()">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </span>
        </div>
        <table class="table table-border table-bordered table-hover table-bg mt-20">
            <thead>
            <tr class="text-c">
                <th width="80">
                    <div class="check-box">
                        <input type="checkbox" id="checkAll">
                    </div>
                </th>
                <th width="150">帐号</th>
                <th width="150">姓名</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="vo"}
            <tr class="text-c">
                <td>
                    <div class="check-box">
                        <input type="checkbox" name="user_id[]" value="{$vo.id}"/>
                    </div>
                </td>
                <td>{$vo.account}</td>
                <td>{$vo.realname}</td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        var checks = '{$checks}'.split(",");
        if (checks.length > 0){
            for (var i in checks){
                $("[name='user_id[]'][value='"+checks[i]+"']").attr("checked",true);
            }
        }

        $("#form").Validform({
            tiptype:2,
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}